package com.zzyl.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.zzyl.base.PageResponse;
import com.zzyl.entity.NursingProject;
import com.zzyl.mapper.NursingProjectMapper;
import com.zzyl.service.NursingProjectService;
import com.zzyl.vo.NursingProjectVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class NursingProjectServiceImpl implements NursingProjectService {
    @Autowired
    NursingProjectMapper nursingProjectMapper;


    @Override
    public PageResponse<NursingProjectVo> selectByPage(Integer pageNum, Integer pageSize, String name, Integer status) {
        PageHelper.startPage(pageNum,pageSize);

        Page<NursingProject> page=nursingProjectMapper.selectByPage(name,status);

        PageResponse<NursingProjectVo> of = PageResponse.of(page, NursingProjectVo.class);


        return of;
    }
}
